import Header from "../components/Header.js";
import Footer from "../components/Footer.js";
import HomeComponents from "../components/Home";
import { getNewest } from "./api/articles";
function Home({ newList }) {
  return (
    <div>
      <Header title={"个人博客"}></Header>
      <HomeComponents newList={newList}></HomeComponents>
      <Footer></Footer>
    </div>
  );
}
export const getStaticProps = async () => {
  let result = await getNewest();
  const { data, message, code } = result;
  // console.log(data, message, code, 'result')
  return {
    props: {
      newList: data,
    },
  };
};
export default Home;
